home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / pascal / swag / crt.swg / 0023_BIOS Control.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-08-24  |  2.2 KB  |  88 lines

  1. {
  2. ML>Basically a function that allows me to have 3 lines at the top non scrollabl
  3. ML>(that I can change, the content of the lines), but so the stuff underthem
  4. ML>scrolles...
  5.  
  6. Well, when you don't like the way the BIOS scrolls the screen, change
  7. the BIOS!
  8.  
  9. Here's an interesting program that I just wrote for this purpose.  It
  10. installs a TSR-like program that interferes with the BIOS scroll-up
  11. routine and forces the top to be a variable you set.
  12.  
  13. While debugging the program, I ran into a bit of trouble with the way
  14. that TP handles interrupts.  If you notice, half of the ISR has turned
  15. into restoring the registers that TP trashes!
  16. ========================================================================
  17. }
  18. Uses Dos, Crt; {Crt only used by main pgm}
  19.  
  20. var
  21.   TopLine : byte;
  22.   V       : STRING;
  23.   OldInt  : Procedure;
  24.  
  25. {Procedure Catch is the actual ISR, filtering out BIOS SCROLL-UP commands, and
  26.  forcing the top of the scroll to be the value [TopLine] }
  27.  
  28. {$F+}
  29. procedure Catch(Flags, rCS, rIP, rAX, rBX, rCX, rDX, rSI, rDI, rDS, rES, rBP: WORD); INTERRUPT;
  30. {  Procedure Catch; interrupt;}
  31.   begin {Catch}
  32.     asm
  33.       MOV  AX, Flags
  34.       SAHF
  35.       MOV  AX, rAX
  36.       MOV  BX, rBX
  37.       MOV  CX, rCX
  38.       MOV  DX, rDX
  39.       MOV  SI, rSI
  40.       MOV  DI, rDI
  41.       CMP  AH, 06
  42.       JNE  @Pass
  43.       CMP  CH, TopLine
  44.       JA   @Pass
  45.       MOV  CH, TopLine
  46.  
  47. @Pass:
  48.     end;
  49.     OldInt;          {Pass through to old handler}
  50.     asm
  51.       MOV  rAX, AX
  52.       MOV  rBX, BX
  53.       MOV  rCX, CX
  54.       MOV  rDX, DX
  55.       MOV  rSI, SI
  56.       MOV  rDI, DI
  57.     end;
  58.   end; {Catch}
  59. {$F-}
  60.  
  61.   Procedure Install;
  62.   begin
  63.     GetIntVec($10, Addr(OldInt));
  64.     SetIntVec($10, Addr(Catch));
  65.   end;
  66.  
  67.   Procedure DeInstall;
  68.   begin
  69.     SetIntVec($10, Addr(OldInt));
  70.   end;
  71.  
  72.   FUNCTION ItisTrue : BOOLEAN;
  73.   BEGIN
  74.   ItisTrue := (V <> 'quit');
  75.   END;
  76.  
  77. begin
  78.   ClrScr;
  79.   DirectVideo := TRUE;
  80.   TopLine := 5; {Keep 5+1 lines at top of screen}
  81.   Install;
  82.   GoToXY(1,24);
  83.   WriteLn('Start Typing to see demo... type "quit" to stop ..');
  84.   while Itistrue do readln(V);
  85.   DeInstall;
  86. end.
  87. ====================================================================
  88.